public class Test {
    public static void main(String[] args) {
        char[] ch = new char[]{'a', 'b', 'c'};
        String s1 = new String(ch);     // s1对象并不在常量池中
        s1.intern();                 // s1.intern()；调用之后，会将s1对象的引用放入到常量池中
        String s2 = "abc";
        System.out.println(s1 == s2);
    }



    public static void main3(String[] args) {
        String str = "abc" + "def";//编译时str就为"abcdef"
    }
}
